package com.td.spring.controller;

import com.td.spring.dao.CustomerMapper;
import com.td.spring.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class
CustomerController {

    @Autowired
    private CustomerMapper customerMapper;
    @RequestMapping("/selectCustomer")
    public List<Customer> selectCustomer(){
        List<Customer> customers = customerMapper.selectCustomer();
        return customers;
    }
    @RequestMapping("/insertCustomer")
    public void insertAlll(Customer customer){
   customerMapper.insertAlll(customer);
    }

}
